﻿/// <reference path="../../release/ajaxstack-core.js"/>
/// <reference path="../../release/jsApp.js"/>

function DemoApp(tagId)
{
	DemoApp.$baseConstructor.call(this, tagId, new AppPages(this), DemoApp.masterControllers);

	this.examplesClient = new JsonServiceClient("http://" + Path.getHostName() + "/ServiceStack.Examples.Host.Web/Public/");
	this.examplesContext = new ExamplesContext(this, this.examplesClient);

	this.menuController = new MenuController(this, "#left");
	this.contexts = [this.examplesContext];
	this.controllers.push(this.menuController);

	var $this = this;
	
	$(function()
	{
		$("HTML").addClass(E.getBrowserName());
		$("HTML").addClass(E.getBrowserNameWithVersion());
		$("HTML").addClass(E.getResolutionName());

		$this.menuController.loadPath(Path.parseHref());
	});
}
DemoApp.extend(AppBase, { type: 'DemoApp' }, {
	getExamplesContext: function()
	{
		return this.examplesContext;
	}
});
DemoApp.masterControllers = [MasterController];
